package com.qf.weapon;

public class Dagger extends Weapon {

    private double spr; // 暴击值


    @Override
    public int caculateDamage(HeroPlus heroPlus) {
        return (int) ((heroPlus.getPower() + this.getAtk()) * this.getSpr());
    }

    /**
     * 打印武器信息
     */
    public void printInfo() {
        System.out.print("名字:" + getName());
        System.out.print(" 类型:" + getType());
        System.out.print(" 攻击力:" + getAtk());
        System.out.println(" 暴击值" + getSpr());
    }

    public Dagger() {
        this("匕首", 0, 10);
        setSpr(1.5);
    }

    public Dagger(String name, int type, int atk) {
        super(name, type, atk);
    }

    public double getSpr() {
        return spr;
    }

    public void setSpr(double spr) {
        this.spr = spr;
    }
}
